package cn.xmy.demo01.service;

import cn.xmy.demo01.pojo.Trolley;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;

public interface TrolleyDaoService {
    //将查询的数据添加到数据库
    int addTrolley(Trolley trolley) throws SQLException, ClassNotFoundException;
    //显示添加的数据
    List<Trolley> FindTrolley() throws SQLException, ClassNotFoundException;
    List<Trolley> FindTrolleys(String id) throws SQLException, ClassNotFoundException;

    List<Trolley> findAllTrolley() throws SQLException, ClassNotFoundException;

    // 根据 id 更新商品的数量和总价
    int updateShopQuantity(@Param("id") String id,
                           @Param("number") int number,
                           @Param("total") double total);

    // 根据 id 查询商品价格
    double getPriceById(String id);

    //个人中心查询
    List<Trolley> findZhi1() throws SQLException, ClassNotFoundException;
    List<Trolley> findZhi2() throws SQLException, ClassNotFoundException;
    List<Trolley> findZhi3() throws SQLException, ClassNotFoundException;
    List<Trolley> findZhi4() throws SQLException, ClassNotFoundException;
    //根据Id修改状态编号
    int updateZhiId(String id) throws SQLException, ClassNotFoundException;
}
